The present disclosure relates to the data-processing field. More specifically, this disclosure relates to the logging of information.
Logging (i.e., recording of information relating to events occurred over time into corresponding records of a memory structure, referred to as log) is a commonplace activity in several data-processing fields. For example, a particular application of the logging is tracing of a software program; in this case, the logged records relate to execution of the software program, and they are used for its debugging (either during development or after delivery of the software program).
Log analysis (i.e., scrutiny of logs in order to understand the corresponding events) poses many challenges. For example, in the case of the debugging of a software program, the corresponding log is analyzed in response to any error that results in malfunctioning thereof; this is aimed at extracting information about the context wherein the error occurred, which information may facilitate a diagnostic process (for determining a cause of the error and then taking appropriate corrective actions to fix it). For this purpose, since the errors may occur randomly, a time granularity of the log should be kept sufficiently high so as to ensure that all the records providing useful information for any possible errors are available when it is necessary; moreover, since the errors are relatively rare, most of the records relate to a correct operation of the program. However, this makes the log very large (i.e., verbose), so that it is quite difficult to identify the information of actual interest among the huge amount of records that are logged (most of which are irrelevant for debugging purposes).
Several techniques have been proposed in the art in an attempt to facilitate the log analysis.
For example, known prior art describes a profiling functionality that may be qualified by setting various qualifying flags at the request of a user, which qualifying flags may be used to limit the amount of trace data being generated or processed.
Other known prior art describes the use of configuration information to specify particular conditions under which trace events are to be logged.
Other known prior art describes the use of a very small trace buffer (typically, with 16 entries), which is compacted by removing traces from it before copying or moving the traces to some other storage location or before streaming them out in real-time.
Other known prior art describes creating a subordinate memory buffer whenever a nested subroutine is called inside a subroutine. Upon completion of each subroutine execution, the corresponding memory buffer is deleted; conversely, when an event is encountered during execution, all data in currently existing memory buffers are transferred to a secondary memory storage device.
Other known prior art describes logging trace messages in a trace log that is maintained in memory. The trace messages logged during execution of a portion of programming code are deleted when the portion of programming code executes without any error, whereas the trace messages are maintained in the trace log when an error occurs; when the execution of the programming code ends, the trace log is stored into a trace log file or it is displayed. In addition, a test log generated as described above may be merged with a product log including messages regarding actions performed during execution of the programming code.
However, any conditional logging is of no benefit when the information of interest is not known a priori (for example, for debugging purposes in the event of random errors).
Moreover, when the information is pre-processed in a working memory before its actual logging, a system crash would cause a loss of the information still to be logged; this pre-processing also involves a waste of memory space, and it involves a corresponding delay for the availability of the information in the log.
The use of distinct logs may instead cause synchronization errors when they are merged (for example, because of different time granularities); in any case, it requires a post-processing of the different logs for allowing a meaningful analysis thereof.